翻訳と辞書
Words near each other
・ lisp machine lisp
・ lisp object-oriented programming system
・ lisp, objects, and symbolic programming
・ lisp-linda
・ lisp70
・ lispkit
・ lispkit lisp
・ lisptalk
・ lispview
・ list
list comprehension
・ list enhanced
・ listless
・ listproc
・ lists
・ listserv
・ liszt
・ lite
・ literal
・ literate programming


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

list comprehension : FOLDOC
list comprehension
An expression in a functional language denoting the results of some operation on (selected) elements of one or more lists. An example in Haskell:
[ (x,y) | x <- [1 .. 6], y <- [1 .. x], x+y < 10]
This returns all pairs of numbers (x,y) where x and y are elements of the list 1, 2, ..., 10, y <= x and their sum is less than 10.
A list comprehension is simply "syntactic sugar" for a combination of applications of the functions, concat, map and filter. For instance the above example could be written:
filter p (concat (map ( x -> map ( y -> (x,y))
[1..x]) [1..6]))
where
p (x,y) = x+y < 10

According to a note by Rishiyur Nikhil , (August 1992), the term itself seems to have been coined by Phil Wadler circa 1983-5, although the programming construct itself goes back much further (most likely Jack Schwartz and the SETL language).
The term "list comprehension" appears in the refe


スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.